package basic;

import java.util.Arrays;

/**
 * @program: java-base->ZhiAndYinYong
 * @description:
 * @author: G_Y
 * @create: 2019-09-18 16:23
 **/
public class ZhiAndYinYong {
    public static void main(String[] args) {
        int i = 1;
        String str = new String("hello");
//        String str = "hello";
        int[] arr = {1, 2, 3};
        Arrb arrb = new Arrb();
        change(i, str, arr, arrb.a);
        System.out.println("i=" + i);                       //1
        System.out.println("str=" + str);                   //hello
        System.out.println("arr=" + Arrays.toString(arr));  //2,2,3
        System.out.println(arrb.a);                         //1
        change1(i, str, arr, arrb);
        System.out.println(arrb.a);                         //2
    }

    public static void change(int i, String arr, int[] a, int ar) {
        i += 1;
        arr += " world";
        a[0] += 1;
        ar += 1;
    }

    public static void change1(int i, String arr, int[] a, Arrb ar) {
        i += 1;
        arr += "world";
        a[0] += 1;
        ar.a += 1;
    }

}

class Arrb {
    int a = 1;
}



